package ar.edu.itba.pod.legajo45129.balance.api;

import ar.edu.itba.node.NodeInformation;

/**
 * Wrapp class to help balancing calculation
 * @author xwgou
 *
 */
public class AgentsOnNode implements Comparable<AgentsOnNode>{
	
	private NodeInformation node;
	private int agents;
	private int balanceDif;
	
	public AgentsOnNode(NodeInformation node, int agents) {
		this.node = node;
		this.agents = agents;
	}

	@Override
	public int compareTo(AgentsOnNode o) {
		if (o.agents == this.agents) {
			return 0;
		}
		
		if (o.agents < this.agents) {
			return -1;
		}
		
		return 1;
	}

	public NodeInformation getNode() {
		return node;
	}

	public void setNode(NodeInformation node) {
		this.node = node;
	}

	public int getAgents() {
		return agents;
	}

	public void setAgents(int agents) {
		this.agents = agents;
	}

	public int getBalanceDif() {
		return balanceDif;
	}

	public void setBalanceDif(int balanceDif) {
		this.balanceDif = balanceDif;
	}
	
	@Override
	public String toString() {
		return node + " | " + agents + " | " + balanceDif;

	}
	
}